/*
               File: type_SdtSmoothNavMenuData_SmoothNavMenuItem
        Description: SmoothNavMenuData
             Author: GeneXus C# Generator version 10_2_5-78484
       Generated on: 6/6/2014 9:53:21.92
       Program type: Callable routine
          Main DBMS: sqlserver
*/
using System;
using System.Collections;
using GeneXus.Utils;
using GeneXus.Resources;
using GeneXus.Application;
using GeneXus.Metadata;
using GeneXus.Data;
using GeneXus.Data.ADO;
using GeneXus.Data.NTier;
using GeneXus.Data.NTier.ADO;
using System.Runtime.Remoting;
using GeneXus.XML;
using GeneXus.Search;
using GeneXus.Encryption;
using GeneXus.Http.Client;
using System.Reflection;
using System.Xml.Serialization;
using System.Data.SqlTypes;
using System.ServiceModel;
using System.Runtime.Serialization;
namespace GeneXus.Programs {
   [XmlSerializerFormat]
   [XmlRoot(ElementName = "SmoothNavMenuData.SmoothNavMenuItem" )]
   [XmlType(TypeName =  "SmoothNavMenuData.SmoothNavMenuItem" , Namespace = "DeMolay" )]
   [System.Xml.Serialization.XmlInclude( typeof( SdtSmoothNavMenuData_SmoothNavMenuItem ))]
   [Serializable]
   public class SdtSmoothNavMenuData_SmoothNavMenuItem : GxUserType
   {
      public SdtSmoothNavMenuData_SmoothNavMenuItem( )
      {
         constructorCallingAssembly = Assembly.GetCallingAssembly();
         initialize();
      }

      public SdtSmoothNavMenuData_SmoothNavMenuItem( IGxContext context )
      {
         this.context = context;
         constructorCallingAssembly = Assembly.GetCallingAssembly();
         initialize();
      }

      public override String ToXml( bool includeHeader ,
                                    bool includeState ,
                                    String name ,
                                    String sNameSpace )
      {
         String s ;
         XmlSerializer xmls ;
         xmls = new XmlSerializer(this.GetType(), sNameSpace);
         System.IO.MemoryStream stream = new System.IO.MemoryStream();
         System.Xml.XmlWriter xmlw = System.Xml.XmlWriter.Create(stream, new System.Xml.XmlWriterSettings() { OmitXmlDeclaration = !includeHeader});
         XmlSerializerNamespaces xmlns = new XmlSerializerNamespaces();
         xmlns.Add(String.Empty, sNameSpace);
         xmls.Serialize( xmlw, this, xmlns);
         stream.Seek(0L, System.IO.SeekOrigin.Begin);
         System.IO.StreamReader sr = new System.IO.StreamReader(stream);
         s = sr.ReadToEnd();
         stream.Close();
         return s ;
      }

      public override void FromXml( String s ,
                                    String name )
      {
         SdtSmoothNavMenuData_SmoothNavMenuItem deserialized ;
         if (s.Trim().Length == 0)
            return;
         XmlSerializer xmls = new XmlSerializer(this.GetType(),  "DeMolay" );
         System.IO.StringReader sr = new System.IO.StringReader(s);
         deserialized = (SdtSmoothNavMenuData_SmoothNavMenuItem)(xmls.Deserialize( sr)) ;
         sr.Close();
         SdtSmoothNavMenuData_SmoothNavMenuItem obj ;
         obj = this;
         obj.gxTpr_Id = deserialized.gxTpr_Id;
         obj.gxTpr_Title = deserialized.gxTpr_Title;
         obj.gxTpr_Description = deserialized.gxTpr_Description;
         obj.gxTpr_Link = deserialized.gxTpr_Link;
         obj.gxTpr_Linktarget = deserialized.gxTpr_Linktarget;
         obj.gxTpr_Items = deserialized.gxTpr_Items;
         return  ;
      }

      public override short readxml( GXXMLReader oReader ,
                                     String sName )
      {
         short GXSoapError = 1 ;
         sTagName = oReader.Name;
         if ( oReader.IsSimple == 0 )
         {
            GXSoapError = oReader.Read();
            nOutParmCount = 0;
            while ( ( ( StringUtil.StrCmp(oReader.Name, sTagName) != 0 ) || ( oReader.NodeType == 1 ) ) && ( GXSoapError > 0 ) )
            {
               readOk = 0;
               if ( StringUtil.StrCmp2( oReader.LocalName, "Id") )
               {
                  gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id = oReader.Value;
                  if ( GXSoapError > 0 )
                  {
                     readOk = 1;
                  }
                  GXSoapError = oReader.Read();
               }
               if ( StringUtil.StrCmp2( oReader.LocalName, "Title") )
               {
                  gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title = oReader.Value;
                  if ( GXSoapError > 0 )
                  {
                     readOk = 1;
                  }
                  GXSoapError = oReader.Read();
               }
               if ( StringUtil.StrCmp2( oReader.LocalName, "Description") )
               {
                  gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description = oReader.Value;
                  if ( GXSoapError > 0 )
                  {
                     readOk = 1;
                  }
                  GXSoapError = oReader.Read();
               }
               if ( StringUtil.StrCmp2( oReader.LocalName, "Link") )
               {
                  gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link = oReader.Value;
                  if ( GXSoapError > 0 )
                  {
                     readOk = 1;
                  }
                  GXSoapError = oReader.Read();
               }
               if ( StringUtil.StrCmp2( oReader.LocalName, "LinkTarget") )
               {
                  gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget = oReader.Value;
                  if ( GXSoapError > 0 )
                  {
                     readOk = 1;
                  }
                  GXSoapError = oReader.Read();
               }
               if ( StringUtil.StrCmp2( oReader.LocalName, "Items") )
               {
                  if ( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items == null )
                  {
                     gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items = new GxObjectCollection( context, "SmoothNavMenuData.SmoothNavMenuItem", "DeMolay", "SdtSmoothNavMenuData_SmoothNavMenuItem", "GeneXus.Programs");
                  }
                  if ( ( oReader.IsSimple == 0 ) || ( oReader.AttributeCount > 0 ) )
                  {
                     GXSoapError = gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items.readxml(oReader, "Items");
                  }
                  if ( GXSoapError > 0 )
                  {
                     readOk = 1;
                  }
                  GXSoapError = oReader.Read();
               }
               nOutParmCount = (short)(nOutParmCount+1);
               if ( readOk == 0 )
               {
                  context.sSOAPErrMsg = context.sSOAPErrMsg + "Error reading " + sTagName + StringUtil.NewLine( );
                  GXSoapError = (short)(nOutParmCount*-1);
               }
            }
         }
         return GXSoapError ;
      }

      public override void writexml( GXXMLWriter oWriter ,
                                     String sName ,
                                     String sNameSpace )
      {
         writexml(oWriter, sName, sNameSpace, true);
         return  ;
      }

      public override void writexml( GXXMLWriter oWriter ,
                                     String sName ,
                                     String sNameSpace ,
                                     bool sIncludeState )
      {
         if ( String.IsNullOrEmpty(StringUtil.RTrim( sName)) )
         {
            sName = "SmoothNavMenuData.SmoothNavMenuItem";
         }
         if ( String.IsNullOrEmpty(StringUtil.RTrim( sNameSpace)) )
         {
            sNameSpace = "DeMolay";
         }
         oWriter.WriteStartElement(sName);
         if ( StringUtil.StrCmp(StringUtil.Left( sNameSpace, 10), "[*:nosend]") != 0 )
         {
            oWriter.WriteAttribute("xmlns", sNameSpace);
         }
         else
         {
            sNameSpace = StringUtil.Right( sNameSpace, (short)(StringUtil.Len( sNameSpace)-10));
         }
         oWriter.WriteElement("Id", StringUtil.RTrim( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id));
         if ( StringUtil.StrCmp(sNameSpace, "DeMolay") != 0 )
         {
            oWriter.WriteAttribute("xmlns", "DeMolay");
         }
         oWriter.WriteElement("Title", StringUtil.RTrim( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title));
         if ( StringUtil.StrCmp(sNameSpace, "DeMolay") != 0 )
         {
            oWriter.WriteAttribute("xmlns", "DeMolay");
         }
         oWriter.WriteElement("Description", StringUtil.RTrim( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description));
         if ( StringUtil.StrCmp(sNameSpace, "DeMolay") != 0 )
         {
            oWriter.WriteAttribute("xmlns", "DeMolay");
         }
         oWriter.WriteElement("Link", StringUtil.RTrim( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link));
         if ( StringUtil.StrCmp(sNameSpace, "DeMolay") != 0 )
         {
            oWriter.WriteAttribute("xmlns", "DeMolay");
         }
         oWriter.WriteElement("LinkTarget", StringUtil.RTrim( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget));
         if ( StringUtil.StrCmp(sNameSpace, "DeMolay") != 0 )
         {
            oWriter.WriteAttribute("xmlns", "DeMolay");
         }
         if ( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items != null )
         {
            String sNameSpace1 ;
            if ( StringUtil.StrCmp(sNameSpace, "DeMolay") == 0 )
            {
               sNameSpace1 = "[*:nosend]" + "DeMolay";
            }
            else
            {
               sNameSpace1 = "DeMolay";
            }
            gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items.writexml(oWriter, "Items", sNameSpace1);
         }
         oWriter.WriteEndElement();
         return  ;
      }

      public override void ToJSON( )
      {
         ToJSON( true) ;
         return  ;
      }

      public override void ToJSON( bool includeState )
      {
         AddObjectProperty("Id", (Object)(gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id), false);
         AddObjectProperty("Title", (Object)(gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title), false);
         AddObjectProperty("Description", (Object)(gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description), false);
         AddObjectProperty("Link", (Object)(gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link), false);
         AddObjectProperty("LinkTarget", (Object)(gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget), false);
         if ( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items != null )
         {
            AddObjectProperty("Items", (Object)(gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items), false);
         }
         return  ;
      }

      [  SoapElement( ElementName = "Id" )]
      [  XmlElement( ElementName = "Id"   )]
      public String gxTpr_Id
      {
         get {
            return gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id ;
         }

         set {
            gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id = (String)(value);
         }

      }

      public void gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id_SetNull( )
      {
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id = "";
         return  ;
      }

      public bool gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id_IsNull( )
      {
         return false ;
      }

      [  SoapElement( ElementName = "Title" )]
      [  XmlElement( ElementName = "Title"   )]
      public String gxTpr_Title
      {
         get {
            return gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title ;
         }

         set {
            gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title = (String)(value);
         }

      }

      public void gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title_SetNull( )
      {
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title = "";
         return  ;
      }

      public bool gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title_IsNull( )
      {
         return false ;
      }

      [  SoapElement( ElementName = "Description" )]
      [  XmlElement( ElementName = "Description"   )]
      public String gxTpr_Description
      {
         get {
            return gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description ;
         }

         set {
            gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description = (String)(value);
         }

      }

      public void gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description_SetNull( )
      {
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description = "";
         return  ;
      }

      public bool gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description_IsNull( )
      {
         return false ;
      }

      [  SoapElement( ElementName = "Link" )]
      [  XmlElement( ElementName = "Link"   )]
      public String gxTpr_Link
      {
         get {
            return gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link ;
         }

         set {
            gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link = (String)(value);
         }

      }

      public void gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link_SetNull( )
      {
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link = "";
         return  ;
      }

      public bool gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link_IsNull( )
      {
         return false ;
      }

      [  SoapElement( ElementName = "LinkTarget" )]
      [  XmlElement( ElementName = "LinkTarget"   )]
      public String gxTpr_Linktarget
      {
         get {
            return gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget ;
         }

         set {
            gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget = (String)(value);
         }

      }

      public void gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget_SetNull( )
      {
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget = "";
         return  ;
      }

      public bool gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget_IsNull( )
      {
         return false ;
      }

      public class gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items_SdtSmoothNavMenuData_SmoothNavMenuItem_80compatibility:SdtSmoothNavMenuData_SmoothNavMenuItem {}
      [  SoapElement( ElementName = "Items" )]
      [  XmlElement( ElementName = "Items"   )]
      public GxObjectCollection gxTpr_Items_GxObjectCollection
      {
         get {
            if ( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items == null )
            {
               gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items = new GxObjectCollection( context, "SmoothNavMenuData.SmoothNavMenuItem", "DeMolay", "SdtSmoothNavMenuData_SmoothNavMenuItem", "GeneXus.Programs");
            }
            return (GxObjectCollection)gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items ;
         }

         set {
            if ( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items == null )
            {
               gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items = new GxObjectCollection( context, "SmoothNavMenuData.SmoothNavMenuItem", "DeMolay", "SdtSmoothNavMenuData_SmoothNavMenuItem", "GeneXus.Programs");
            }
            gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items = (GxObjectCollection) value;
         }

      }

      [SoapIgnore]
      [XmlIgnore]
      public IGxCollection gxTpr_Items
      {
         get {
            if ( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items == null )
            {
               gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items = new GxObjectCollection( context, "SmoothNavMenuData.SmoothNavMenuItem", "DeMolay", "SdtSmoothNavMenuData_SmoothNavMenuItem", "GeneXus.Programs");
            }
            return gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items ;
         }

         set {
            gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items = value;
         }

      }

      public void gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items_SetNull( )
      {
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items = null;
         return  ;
      }

      public bool gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items_IsNull( )
      {
         if ( gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items == null )
         {
            return true ;
         }
         return false ;
      }

      public void initialize( )
      {
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id = "";
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title = "";
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description = "";
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link = "";
         gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget = "";
         sTagName = "";
         return  ;
      }

      protected short readOk ;
      protected short nOutParmCount ;
      protected String gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Id ;
      protected String gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Title ;
      protected String gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Description ;
      protected String gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Link ;
      protected String gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Linktarget ;
      protected String sTagName ;
      protected Assembly constructorCallingAssembly ;
      [ObjectCollection(ItemType=typeof( SdtSmoothNavMenuData_SmoothNavMenuItem ))]
      protected IGxCollection gxTv_SdtSmoothNavMenuData_SmoothNavMenuItem_Items=null ;
   }

   [DataContract(Name = "SmoothNavMenuData.SmoothNavMenuItem", Namespace = "DeMolay")]
   public class SdtSmoothNavMenuData_SmoothNavMenuItem_RESTInterface : GxGenericCollectionItem<SdtSmoothNavMenuData_SmoothNavMenuItem>, System.Web.SessionState.IRequiresSessionState
   {
      public SdtSmoothNavMenuData_SmoothNavMenuItem_RESTInterface( ) : base()
      {
      }

      public SdtSmoothNavMenuData_SmoothNavMenuItem_RESTInterface( SdtSmoothNavMenuData_SmoothNavMenuItem psdt ) : base(psdt)
      {
      }

      [DataMember( Name = "Id" , Order = 0 )]
      public String gxTpr_Id
      {
         get {
            return StringUtil.RTrim( sdt.gxTpr_Id) ;
         }

         set {
            sdt.gxTpr_Id = (String)(value);
         }

      }

      [DataMember( Name = "Title" , Order = 1 )]
      public String gxTpr_Title
      {
         get {
            return StringUtil.RTrim( sdt.gxTpr_Title) ;
         }

         set {
            sdt.gxTpr_Title = (String)(value);
         }

      }

      [DataMember( Name = "Description" , Order = 2 )]
      public String gxTpr_Description
      {
         get {
            return StringUtil.RTrim( sdt.gxTpr_Description) ;
         }

         set {
            sdt.gxTpr_Description = (String)(value);
         }

      }

      [DataMember( Name = "Link" , Order = 3 )]
      public String gxTpr_Link
      {
         get {
            return StringUtil.RTrim( sdt.gxTpr_Link) ;
         }

         set {
            sdt.gxTpr_Link = (String)(value);
         }

      }

      [DataMember( Name = "LinkTarget" , Order = 4 )]
      public String gxTpr_Linktarget
      {
         get {
            return StringUtil.RTrim( sdt.gxTpr_Linktarget) ;
         }

         set {
            sdt.gxTpr_Linktarget = (String)(value);
         }

      }

      [DataMember( Name = "Items" , Order = 5 )]
      public GxGenericCollection<SdtSmoothNavMenuData_SmoothNavMenuItem_RESTInterface> gxTpr_Items
      {
         get {
            return new GxGenericCollection<SdtSmoothNavMenuData_SmoothNavMenuItem_RESTInterface>(sdt.gxTpr_Items) ;
         }

         set {
            value.LoadCollection(sdt.gxTpr_Items);
         }

      }

      public SdtSmoothNavMenuData_SmoothNavMenuItem sdt
      {
         get {
            return (SdtSmoothNavMenuData_SmoothNavMenuItem)Sdt ;
         }

         set {
            Sdt = value ;
         }

      }

      [OnDeserializing]
      void checkSdt( StreamingContext ctx )
      {
         if ( sdt == null )
         {
            sdt = new SdtSmoothNavMenuData_SmoothNavMenuItem() ;
         }
      }

   }

}
